package pl.edu.mimuw.mas.test;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import pl.edu.mimuw.mas.agent.HelicopterAgent;
import pl.edu.mimuw.mas.agent.behaviour.helicopter.BroadcastDeerPositionBehaviour;
import pl.edu.mimuw.mas.agent.behaviour.helicopter.verification.FollowDeerBehaviour;
import pl.edu.mimuw.mas.chart.Chart;
import pl.edu.mimuw.mas.util.PositionHelper;

public class DummyHelicopterAgent extends HelicopterAgent {
	private static final long serialVersionUID = 5208354843249834270L;
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	
	protected void setup() {
		if (!setServiceAgents()) {
			doDelete();
			return;
		}
		
		setLanguages();
		
		try {
			Object[] obj = getArguments();
			chart = (Chart) obj[0];
		} catch (Exception e) {
			logger.error("{}: Błąd podczas setup() {}", getName(), e);
			doDelete();
			return;
		}

		position = PositionHelper.getDeerPosition();
		
		addBehaviour(new FollowDeerBehaviour(this));
		addBehaviour(new BroadcastDeerPositionBehaviour(this));
	}

}
